#@ucenter_layout()
#define script()
<script>

    function del(id) {
        if (confirm("确定要删除该文章吗？删除后不可恢复")) {
            ajaxGet("#(CPATH)/ucenter/article/doDel/" + id)
        }
    }
</script>

#end

#define content()
<section class="content">

    <div class="container-fluid">
        <div class="card card-outline card-primary">
            <div class="card-header with-border">
            </div>
            <!-- /.card-header -->
            <div class="card-body p-0">
                <table class="table table-striped">
                    <tbody>
                    <tr>
                        <th style="width: 350px">标题</th>
                        <th>分类</th>
                        <th>标签</th>
                        <th style="width: 50px"><i class="fa fa-commenting"></i></th>
                        <th style="width: 90px">发布时间</th>
                    </tr>
                    #for(article : page.list ??)
                    <tr>
                        <td>
                            <strong>
                                #if(article.isNormal())
                                <a href="#(article.url ??)" target="_blank">#(article.title ??)</a>
                                #else
                                <a href="#(CPATH)/ucenter/article/write/#(article.id)">#(article.title ??)</a>
                                （审核中...）
                                #end
                            </strong>

                            #if(!article.isNormal())
                            <div class="jp-action-card">
                                <div class="jp-action-body">
                                    <a href="#(CPATH)/ucenter/article/write/#(article.id)">编辑</a> |
                                    <a href="javascript:;" onclick="del('#(article.id??)')" class="red-action">永久删除</a>
                                </div>
                            </div>
                            #end

                        </td>
                        <td>
                            #articleCategories(article.id,"category")
                            #for(category : categories)
                            <a href="#(category.url ??)" target="_blank">#(category.title ??)</a>
                            #if(!for.last) , #end
                            #end
                            #end
                        </td>
                        <td>
                            #articleCategories(article.id,"tag")
                            #for(category : categories)
                            <a href="#(category.url ??)" target="_blank">#(category.title ??)</a>
                            #if(!for.last) , #end
                            #end
                            #end
                        </td>
                        <td>#(article.comment_count ??)</td>
                        <td>#date(article.created)</td>
                    </tr>
                    #else
                    <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                    #end
                    </tbody>
                </table>
            </div>
            <!-- /.card-body -->
            <div class="card-footer">
                <div class="row">
                    <div class="col-sm-12">
                        #@_paginate()
                    </div>
                </div>
            </div>
            <!-- /.card-footer -->
        </div>
        <!-- /.card -->
    </div>
</section>

#end
